home *** CD-ROM | disk | FTP | other *** search
- Date: Mon, 18 Jan 93 10:12:16 MST
- From: Michal Jaegermann <NTOMCZAK@vm.ucs.UAlberta.CA>
- Subject: Re: libraries
- To: mint@terminator.rs.itd.umich.edu
-
-
- In response to my proposition for organization of headers/libraries
- to accomodate both MiNT and TOS in a transparent manner Julian Reschke
- writes:
- > This is exactly what I don't want.
-
- I am sorry, but in that case I do not know what do you want. Maybe we
- can have some examples, please.
-
- For those who may not know. I spent enough time dabbling in gcc-ST
- headers and libraries to know that current headers are unified and
- few neccessary differences can be easily accomodated internally
- using #ifdef...#endif. My example with <stdio.h> was just that, an
- example. Still, I had an impression that Julian, with a support of
- Eric, needs/wants some extra, separate header files which will live
- in their own subdirectories. That is fine as well if such need
- arises. I only indicated that we do not need to burden a compiler
- user with a need to explicitely refer to these subtrees. All magic
- can be simply hidden in a compiler driver.
-
- As far as library go this is somewhat more complicated. A bulk of TOS
- and MiNT libraries is exactly the same. Still there are some
- functions with the same names (and which have to have the same names)
- which are doing somewhat different things for MiNT and TOS. Keeping
- them in the same library and leaving for a linker to sort them out may
- be somewhat difficult. :-) On the other hand it does not require much
- smarts from a compiler driver to pick up proper sub-libraries and pass
- them to 'ld' in a linking phase.
-
- Last but not least. My suggestion to use zmodem for a conversion
- between LF and CR/LF line terminators was not entirely serious. I
- even added a 'smiley face' for those less observant. If your editor
- is unhappy in an absence of CR and will not add these characters for
- you then something in this style (adjust to your particular shell)
- should work for LF -> CR/LF conversion:
-
- for file in $*
- do
- cat $file > $TEMP/$file
- mv $TEMP/$file $file
- done
-
- The above assumes ST, more or less sane 'cat' and "text i/o". Awk or
- Perl will work equally well. Going the other way may require some
- utility since you need binary file write but entropy promissed to
- solve that problem for you.
-
- For those with Unix machines handy here are two conversion scripts
- (but replace ^M and ^Z in the second script with their real control
- counterparts which would not survive e-mail).
-
- #!/bin/sh
- #clean
- #shell script for removal of all ^M's and ^Z's from a file or files
- #do not use that on binaries
- #
- for file in $*
- do
- # echo $file
- tr -d '\015\032' < $file >/tmp/$file.$$
- mv /tmp/$file.$$ $file
- done
- exit 0
-
- #!/bin/sh
- #mess
- #shell script for adding ^M's to all lines in a text file
- #do not use that on binaries
- #
- for file in $*
- do
- # echo $file
- sed 's/$/^M/' $file >/tmp/$file.$$
- # uncomment the next line if you really would like to be MS-DOSish
- # echo '^Z' >> /tmp/$file.$$
- mv /tmp/$file.$$ $file
- done
- exit 0
-
- Happy conversions
- Michal
-